<script setup>
import Hello from './Hello.vue'
import {onBeforeMount, onMounted, onUnmounted, ref} from 'vue'

const msg = ref('abc')
const tt = ref()
let timer

function tok() {
  timer = setInterval(() => {
    tt.value = new Date().toLocaleTimeString()
  }, 1000)
}

onBeforeMount(() => {
  timer = setInterval(() => {
    tt.value = new Date().toLocaleTimeString()
  }, 0)
})
onMounted(tok)
onUnmounted(() => {
  clearInterval(timer)
})
</script>

<template>
  <h3>{{ tt }}</h3>
  <Hello/>
  {{ msg }}
  {{ msg }}
</template>

<style>
</style>
